package com.oop9.car;

/**
 * 5:轿车分为 大众，五菱，奔驰等；车辆都有颜色，车牌等属性， 有启动，加速，刹车等方法。
 * 车辆检测中心（有电话，地址等属性）检测车辆的方法都是一样的：检测车辆的启动，加速，刹车是否正常。 用oop的思想模拟。
 * 
 * @author zhaoyang
 *
 */
public class CarTestCenter {
	private String phone;
	private String address;

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void testCar(Car a) {
		System.out.println("开始检测车辆！");
		System.out.println(">>>>>>>>>>本中心电话：" + this.phone + "，地址位于：" + this.address + "，广告位招租>>>>>>>>>>>>>");
		a.start();
		System.out.println("启动正常！");
		a.accelerate();
		System.out.println("加速正常！");
		a.stop();
		System.out.println("刹车正常！");
		System.out.println("车辆一切正常！");
		System.out.println(">>>>>>>>>>检测结束>>>>>>>>>>>>>");
	}

	public CarTestCenter(String phone, String address) {
		super();
		this.phone = phone;
		this.address = address;
	}

	public static void main(String[] args) {
		Car benz = new Car("奔驰", "红色", "皖A12345");
		Car auto = new Car("大众", "黑色", "皖B23333");
		Car wuling = new Car("五菱之光", "白色", "皖Q08389");

		CarTestCenter c = new CarTestCenter("0551-12580", "包河区葛大店汽车城");
		c.testCar(auto);
		c.testCar(wuling);
		c.testCar(benz);

	}

}
